﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WorkRegister.aspx.cs" Inherits="Runda.CMS.Portal.Mobile.WorkRegister" %>
 <%@ Register Assembly="RadAjax.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html class="ui-mobile landscape min-width-320px min-width-480px min-width-768px min-width-1024px">
<head runat="server">
    <title></title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1" />
    <meta name="GENERATOR" content="MSHTML 8.00.7600.16385" />
    <link rel="stylesheet" href="Content/jquery.mobile-1.0a4.1.min.css" />
     <link rel="stylesheet" href="Content/jquery.mobile.datebox.min.css" type="text/css" />
    <script type="text/javascript" src="Content/jquery-1.5.min.js"></script>
  <script type="text/javascript">
      jQuery.extend(jQuery.mobile.datebox.prototype.options, {
          'experimentalReg': true
      });
      $(document).bind("mobileinit", function() {
          $.mobile.ajaxEnabled = false;
      });
    </script>
    
    <script type="text/javascript" src="Content/jquery.mousewheel.min.js"></script>

    <script type="text/javascript" src="Content/jquery.mobile-1.0a4.1.min.js"></script>
     <script type="text/javascript" src="Content/jquery.mobile.datebox.min.js"></script>

    <link rel="stylesheet" href="Content/jquery.mobile.simpledialog.css" type="text/css" />
    <link rel="stylesheet" href="Content/datepicker.css" type="text/css" />

    <script type="text/javascript" src="Content/dFormat.js"></script>

    <script type="text/javascript" src="Content/datepicker.js"></script>

    <script type="text/javascript" src="Content/jquery.mobile.simpledialog.js"></script>

    <script type="text/javascript" src="Content/g.base.js"></script>
             
    <style type="text/css">
        ul, li
        {
            margin: 0;
            padding: 0;
            width: 100%;
        }
    </style>

    <script language="javascript" type="text/javascript">
        function checkWordForCustomer() {
          
            var customerName = document.getElementById('customerName');
            if(customerName != ''){                        
                var customerMenu = document.getElementById('showmenuCustomer');
                var customerID = document.getElementById('customerID');
                var btnHidden = document.getElementById('btnHidden');

                $.ajax({
                    type: "POST",
                    contentType: "application/json",
                    url: "Services/MobilePortalService.asmx/getCustomer",
                    data: "{nameStr:'" + customerName.value + "'}",
                    dataType: 'json',
                    success: function(data) {                       
                        var alltxtCustomer = data.d.outcome;
                        checkword(customerName, customerMenu, alltxtCustomer, customerID, btnHidden);
                    },
                    error: function() {
                        alert(1);
                        //请求出错处理
                    }
                });                               
            } else{
                        
            }        
        }
    </script>   
</head>
<body class="ui-mobile-viewport">
    <!-- Page starts here -->

    <script type="text/javascript">
        $(document).ready(function() {
            (function() { $('#RegisterDate').bind("tap", { curdatetext: "RegisterDate" }, datepicker.handler); })();
            (function() { $('#ExpectEndDate').bind("tap", { curdatetext: "ExpectEndDate" }, datepicker.handler); })();
        });
    </script>
    <script type="text/javascript">
        function onInstrumentselectchange(val) {           
            $("#instrumentHidden ").val(val);          
        }      
    </script>
    <div style="position: absolute; left: -9999px;">
        <a href="#" id="setfoc"></a>
    </div>
    <div class="ui-page ui-body-c ui-page-active" data-role="page">
        <div class="ui-bar-b ui-header" data-role="header" role="banner">
            <a class="ui-btn-left ui-btn ui-btn-icon-left ui-btn-corner-all ui-shadow ui-btn-up-b"
                data-icon="arrow-l"  href="WorkRegisterList.aspx" data-theme="b"><span class="ui-btn-inner ui-btn-corner-all">
                    <span class="ui-btn-text">后退</span> <span class="ui-icon ui-icon-arrow-l ui-icon-shadow">
                    </span></span></a>
            <h1 class="ui-title" tabindex="0" role="heading" aria-level="1">
                注册单</h1>
        </div>
        <div class="ui-content" data-role="content" role="main">     
            <form id="form1" runat="server">                
            <input id="contactId" type="hidden" />
            <div class="ui-field-contain ui-body ui-br" data-role="fieldcontain">
                <label class="ui-input-text" for="customerName">
                    客户:</label>
                <input id="customerName" type="text" value="" name="customerName" autocomplete="off"
                      runat="server" /><img src="Content/images/icon-search-black.png" width="16px" height="16px" onclick="checkWordForCustomer();" />
                <div style="list-style: none; background-color: white; width: 741px; height: 100px;
                    overflow-y: scroll; z-index: 1; margin: 0 0 0 110px; border: 1px solid #666666;
                    display: none;" id="showmenuCustomer">
                </div>
            </div>
            <div class="ui-field-contain ui-body ui-br" data-role="fieldcontain">
                <label class="select ui-select" for="Instrument">
                    仪器:</label>
                <div class="ui-select">
                    <asp:DropDownList ID="Instrument" runat="server" onchange="onInstrumentselectchange(this.value);">
                    </asp:DropDownList>
                </div>
            </div>
            <div class="ui-field-contain ui-body ui-br" data-role="fieldcontain">
                <label class="ui-input-text" for="RegisterDate">
                    注册日期：</label>
                <input id="RegisterDate" class="ui-input-text ui-body-null ui-corner-all ui-shadow-inset ui-body-c"
                    type="text" value="" name="RegisterDate" runat="server" />
            </div>
            <div class="ui-field-contain ui-body ui-br" data-role="fieldcontain">
                <label class="ui-input-text" for="ExpectEndDate">
                    期望到达日期：</label>
                <input id="ExpectEndDate" class="ui-input-text ui-body-null ui-corner-all ui-shadow-inset ui-body-c"
                    type="text" value="" name="ExpectEndDate" runat="server" />
            </div>
            <div class="ui-field-contain ui-body ui-br" data-role="fieldcontain" style="vertical-align: middle;">
                <label class="ui-input-text" for="ExpectEndTime">
                    期望到达时间：</label>
                <input id="ExpectEndTime"   type="text" runat="server" style="display:none" name="ExpectEndTime" value="10:22" />
                     <input id="ExpectEndTimeView" class="ui-input-text ui-body-null ui-body-c" type="time" data-role="datebox"
                    data-options='{"mode": "timebox"}' name="ExpectEndTimeView" value="10:22" onchange="javascript:$('#ExpectEndTime').val($('#ExpectEndTimeView').val());" />                 
            </div>
            <div class="ui-field-contain ui-body ui-br" data-role="fieldcontain">              
                <label class="select ui-select" for="PerformPerson">
                服务类别：</label>        
                <div class="ui-select">                        
                     <asp:DropDownList ID="TaskType" runat="server">
                         <asp:ListItem Text="维修FE" Value="2"></asp:ListItem>
                        <asp:ListItem Text="维护LS" Value="9"></asp:ListItem>
                        <asp:ListItem Text="保养(应需)" Value="3"></asp:ListItem>
                        <asp:ListItem Text="校准(应需)" Value="6"></asp:ListItem>
                        <asp:ListItem Text="回访(应需)" Value="7"></asp:ListItem>
                        <asp:ListItem Text="学习提高" Value="10"></asp:ListItem>
                        <asp:ListItem Text="跟做标本" Value="11"></asp:ListItem>
                        
                    </asp:DropDownList>
                </div>                                 
            </div>
            <div class="ui-field-contain ui-body ui-br" data-role="fieldcontain">
                <label class="select ui-select" for="PerformPerson">
                    执行人:</label>
                <div class="ui-select">
                    <asp:DropDownList ID="PerformPerson" runat="server">
                    </asp:DropDownList>
                </div>
            </div>
            <div data-role="fieldcontain">
                <label for="Comment">
                    备注:</label>
                <asp:TextBox cols="40" Rows="8" TextMode="MultiLine" ID="Comment" runat="server"></asp:TextBox>
            </div>           
            <div class="ui-body ui-body-b">
                <fieldset class="ui-grid-a">
                    <div class="ui-block-a">
                        <button class="ui-btn-hidden" data-theme="d" type="button" tabindex="-1" onclick="javascript:window.location.href='WorkRegisterList.aspx';">
                            取消</button>
                    </div>
                    <div class="ui-block-b">
                        <button class="ui-btn-hidden" data-theme="a" TabIndex="-1" runat="server"
                            onclick="Formsubmit();">保存</button>
                            <input type="text" style="display: none" id="hiddenM" runat="server" />
                    </div>
                </fieldset>
            </div>
            <div style="display:none">
                <asp:TextBox ID="customerID" runat="server" Style="display: none"></asp:TextBox>
                <asp:Button ID="btnHidden" runat="server" Style="display: none" OnClick="btnHidden_Click" />
                 <asp:Button ID="SaveTask" runat="server" Style="display: none" OnClick="SaveTask_Click" />
                <asp:TextBox ID="instrumentHidden" runat="server" Style="display: none"></asp:TextBox>
                <asp:TextBox ID="TaskTypeHidden" runat="server" Style="display: none"></asp:TextBox>
                <asp:Button runat="server" ID="hiddenRegisterID" Style="display: none" />
          </div>
            </form>
        </div>
        <!-- contentDetail -->         
    </div>   
    <script type="text/javascript">
        function Formsubmit() {
            $('#hiddenM').val('1'); 
            $('#SaveTask').click();
        }
        $(document).ready(function() {
            $('#ExpectEndTimeView').val($('#ExpectEndTime').val());
        });
    </script>
</html>
